<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <button id="btn">获取验证码</button>

    <br><br>

    全选<input type="checkbox" id="c">  
    <br>
    <input type="checkbox" id="c2">  
    <input type="checkbox" id="c3">  
    <input type="checkbox" id="c4">  

    <script>

        // 表单的特殊属性   
        //      disabled  禁用(会禁掉js事件)
        //      checked

        var oBtn = document.getElementById('btn') ;
        oBtn.onclick = function() {
            this.disabled = true ;
            // 倒计时
            setTimeout(function() {
                oBtn.disabled = false ;
            } , 3000)
        }


        var oChk = document.getElementById('c') ;
        setTimeout(function(){
            oChk.checked = true ;
        } , 2000)


    </script>
    
</body>
</html>